<!-- <template>
    <div>
        <iframe src="http://127.0.0.1:8877/login" 
		id="mobsf" 
		frameborder="0"
		 style="position:absolute;top:0px;left: 0px;">
		</iframe>
    </div>
</template>
 
<script lang="ts" setup>
import { onMounted } from 'vue'
		onMounted(()=>{
            /**
            * iframe-宽高自适应显示   
            */
            function changeMobsfIframe(){
                const mobsf = document.getElementById('mobsf');
                const deviceWidth = document.body.clientWidth;
                const deviceHeight = document.body.clientHeight;
                mobsf.style.width = (Number(deviceWidth)-240) + 'px'; //数字是页面布局宽度差值
                mobsf.style.height = (Number(deviceHeight)-64) + 'px'; //数字是页面布局高度差
            }

            changeMobsfIframe()

            window.onresize = function(){
                changeMobsfIframe()
            }
		})
</script> -->

<!--<template>-->
<!--    <div>-->
<!--        <iframe src="http://localhost:9000/boot-admin"-->
<!--		id="mobsf" -->
<!--		frameborder="0"-->
<!--		 style="position:absolute;top:0px;left: 0px;">-->
<!--		</iframe>-->
<!--    </div>-->
<!--</template>-->
<!-- -->
<!--<script lang="ts" setup>-->
<!--import { onMounted } from 'vue'-->
<!--		onMounted(()=>{-->
<!--            /**-->
<!--            * iframe-宽高自适应显示   -->
<!--            */-->
<!--            function changeMobsfIframe(){-->
<!--                const mobsf = document.getElementById('mobsf');-->
<!--                const deviceWidth = document.body.clientWidth;-->
<!--                const deviceHeight = document.body.clientHeight;-->
<!--                mobsf.style.width = (Number(deviceWidth)-240) + 'px'; //数字是页面布局宽度差值-->
<!--                mobsf.style.height = (Number(deviceHeight)-64) + 'px'; //数字是页面布局高度差-->
<!--            }-->

<!--            changeMobsfIframe()-->

<!--            window.onresize = function(){-->
<!--                changeMobsfIframe()-->
<!--            }-->
<!--		})-->
<!--</script>-->


<template>
	<div v-loading="loading" :style="'height:'+ height">
		<iframe id="boot-admin" :src="url" frameborder="no" style="width: 100%;height: 100%" scrolling="auto" />
	</div>
</template>
<script>

// import { getToken } from '@/utils/auth'

export default {
	name: 'BootAdmin',
	data() {
		return {
			height: document.documentElement.clientHeight - 94.5 + 'px;',
			loading: true,
			url: 'http://localhost:8877/boot-admin',
			html: ''
		}
	},
	created: function() {
	  const hasToken = localStorage.getItem('accessToken');
	  console.log("hasToken======"+hasToken);
		// 拼接token
		this.url = this.url
				+ '?Authorization=' + hasToken
	},
	mounted: function() {
		setTimeout(() => {
			this.loading = false
		}, 100)
		const that = this
		window.onresize = function temp() {
			that.height = document.documentElement.clientHeight - 94.5 + 'px;'
		}
	}
}
</script>

